package com.topisv.tms.rest.qimen.command;

import java.util.HashMap;
import java.util.Map;


/**
 * 奇门请求的容器，各个IQMRequestCommand实现类需将自身注册到该容器中
 * 注册的key为对应奇门请求wms系统的method
 *  Date          Author       Version       Description
 * ----------------------------------------------------------
 *  2015-5-4      CC            1.0           Create
 */
public class QMRequestCommandContainer {
	private Map<String, IQMRequestCommand> requests = new HashMap<String, IQMRequestCommand>();

	private static class QMRequestCommandContainerHolder {
		private static QMRequestCommandContainer instance = new QMRequestCommandContainer();
	}

	public static QMRequestCommandContainer getInstance() {
		return QMRequestCommandContainerHolder.instance;
	}

	public void add(String type, IQMRequestCommand command) {
		requests.put(type, command);
	}

	public IQMRequestCommand get(String type) {
		return requests.get(type);
	}
}
